Skip to content

feat: Prepend self:: scopes to proc-macro imports#6

Merged
LumaKernel merged 1 commit intomainfrom
feat/add-self-proc-imports
Nov 10, 2024
Merged

feat: Prepend self:: scopes to proc-macro imports#6
LumaKernel merged 1 commit intomainfrom
feat/add-self-proc-imports

Conversation

@LumaKernel
Copy link
Copy Markdown
Owner

Partially resolves #5

Example:

use memoise::memoise;
use proconio_derive::fastout;

#[fastout]
fn main() {
    for i in 0..=10 {
        println!("{}", fib(i));
    }
}

#[memoise(n <= 10)]
fn fib(n: i64) -> i64 {
    if n == 0 || n == 1 {
        return n;
    }
    fib(n - 1) + fib(n - 2)
}

HEAD:

#[allow(unused_imports)]
use memoise::memoise;
#[allow(unused_imports)]
use proconio_derive::fastout;
pub use __cargo_equip::prelude::*;

/*#[fastout]
....

This PR:

#[allow(unused_imports)]
use self::memoise::memoise;
#[allow(unused_imports)]
use self::proconio_derive::fastout;
pub use __cargo_equip::prelude::*;

/*#[fastout]
....

@LumaKernel LumaKernel self-assigned this Nov 10, 2024
@LumaKernel
Copy link
Copy Markdown
Owner Author

COPIED FROM qryxip/cargo-equip#209 (this is the PR made by me)

@LumaKernel LumaKernel merged commit 4b14d44 into main Nov 10, 2024
@LumaKernel LumaKernel deleted the feat/add-self-proc-imports branch November 10, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Support local run, so it's necessary to import replaced modules with self:: prefix.

1 participant